package com.unisal.java;

public abstract class VendaDePizza {
	
	//FabricaSimplesPizza fabrica = new FabricaSimplesPizza();
	
//	public VendaDePizza(FabricaSimplesPizza fabrica) {
//		this.fabrica = fabrica;
//	}

	public Pizza orderPizza(String type) {
		Pizza pizza;
		
//		if (type.equals("cheese")){
//			pizza = new CheesePizza();
//		}
//		else if (type.equals("greek")){
//			pizza = new GreekPizza();
//		}
//		else if (type.equals("peperoni")){
//			pizza = new PeperoniPizza();
//		}
//		else if (type.equals("clam")){
//			pizza = new ClamPizza();
//		}
//		else if (type.equals("veggie")){
//			pizza = new VeggiePizza();
//		}
		
		pizza = criaPizza(type);
		
		pizza.preparar();
		pizza.assar();
		pizza.cortar();
		pizza.empacotar();
		
		return pizza;
	}

	protected abstract Pizza criaPizza(String tipo);
}
